package com.watson.s2sh.platform.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.watson.s2sh.platform.domain.Menu;
import com.watson.s2sh.platform.service.MenuService;

public class MenuAction extends ActionSupport {
	private static final long serialVersionUID = 1L;

	private Menu menu;
	private List<Menu> menuList;
	
	private MenuService menuService;
	
	public String openMenuList() throws Exception {
		System.out.println("open Menu List Page!");
		menuList = menuService.findAllMenu();
		return SUCCESS;
	}
	
	public String openMenuForm() throws Exception {
		System.out.println("open Menu page!");
		return SUCCESS;
	}
	
	public String saveMenu() throws Exception {
		menuService.save(menu);
		System.out.println("open save successful!");
		menu = new Menu();
		return SUCCESS;
	}


	public MenuService getMenuService() {
		return menuService;
	}

	public void setMenuService(MenuService menuService) {
		this.menuService = menuService;
	}

	public List<Menu> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<Menu> menuList) {
		this.menuList = menuList;
	}

	public Menu getMenu() {
		return menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

}